package org.comeday.valid.vo;

import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.Pattern;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.hibernate.validator.constraints.Length;

/**
 * Program Name: spring_study
 * <p>
 * Description:
 * <p>
 * Created by hkrong on 2024/11/26 11:20
 *
 * @author hkrong
 * @version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class AuthLoginReqVO {

    @NotEmpty(message = "登录账号不能为空")
    @Length(min = 4, max = 20, message = "账号长度为 4-20 位")
    @Pattern(regexp = "^[A-Za-z0-9]+$",message = "账号格式为数字以及字母")
    private String username;

    @NotEmpty(message = "密码不能为空")
    @Length(min = 4, max = 20, message = "密码长度为 4-20 位")
    private String password;
}
